package com.czp.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;

@Controller
public class LoginController {

	@PostMapping("/login")
	public String login(String username, String password, HttpServletRequest request) {
		if ("admin".equals(username) && "admin".equals(password)) {
			request.getSession().setAttribute("user", "user");
			return "redirect:/resume";
		} else {
			return "redirect:/index.jsp";
		}
	}
}
